package com.xyzh05.dao.hibernate;

import java.util.List;

import com.xyzh05.model.Attachment;
import com.xyzh05.dao.AttachmentDao;
import com.xyzh05.dao.hibernate.GenericDaoHibernate;
import org.springframework.stereotype.Repository;

@Repository("attachmentDao")
public class AttachmentDaoHibernate extends GenericDaoHibernate<Attachment, Long> implements AttachmentDao {

    public AttachmentDaoHibernate() {
        super(Attachment.class);
    }
    
    public List<Attachment> findAttachments(Long owenId, Long owenType){
    	String hql = " from Attachment where ownerId = ? and ownerType = ? ";
    	return this.getHibernateTemplate().find(hql,new Object[]{owenId, owenType});
    }
    
}
